<?php
include '../include.php';
ini_set('display_errors', 1);

$query = 'SELECT * FROM `notify` LIMIT 10';
$messages = _database::toarray($query);

$uid = null;
if(count($messages))
foreach($messages as $message)
{
    Notify::send($message['user_id'], $message['message']);
    $uid[] = $message['user_id'];
}

if(is_array($uid) && count($uid))
{
    $query = 'DELETE FROM `notify` WHERE `user_id` IN('.implode(',',$uid).')';
    _database::query($query);
    echo 'deleted '.mysql_affected_rows().' notifyes';
}
?>
